﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace template_dll
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            //- Очистить форму от введённых значений
            dataGridView1.Rows.Clear();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //- Сохранить и выйти
            foreach (DataGridViewRow dr in dataGridView1.Rows)
            {
                if( dr.Cells[0].Value != null)
                ((ChildForm)template_dll.ChildForm.cMain.Form1Control).dt_price_perc.Rows.Add(dr.Cells[0].Value, dr.Cells[1].Value, dr.Cells[2].Value);
            }
            this.Close();
       }
      
    }
}
